package model

import "time"

type Video struct {
	Id         uint      `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	UserId     uint      `gorm:"column:user_id;type:bigint(20) UNSIGNED;comment:用户id;not null;default:0;" json:"user_id"` // 用户id
	CoverImage string    `gorm:"column:cover_image;type:varchar(300);comment:封面图地址;not null;" json:"cover_image"`         // 封面图地址
	VideoUrl   string    `gorm:"column:video_url;type:varchar(300);comment:视频地址;not null;" json:"video_url"`              // 视频地址
	Number     uint      `gorm:"column:number;type:int(10) UNSIGNED;comment:播放数;not null;default:0;" json:"number"`       // 播放数
	Give       uint      `gorm:"column:give;type:int(10) UNSIGNED;comment:点赞数;not null;default:0;" json:"give"`           // 点赞数
	Title      string    `gorm:"column:title;type:varchar(30);comment:标题;not null;" json:"title"`                         // 标题
	Describe   string    `gorm:"column:describe;type:varchar(100);comment:描述;not null;" json:"describe"`                  // 描述
	CreatedAt  time.Time `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt  time.Time `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (v *Video) TableName() string {
	return "video"
}
